package com.nbjtjc.safe.model.sys;

import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiParam;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;

@Table(name = "sys_user")
public class SysUser implements Serializable {
    @Id
    @Column(name = "user_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer userId;

    /**
     * 用户名
     */

    private String username;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空")
    private String password;

    /**
     * 盐
     */
    private String salt;

    /**
     * 邮箱
     */
    @Email(message = "邮箱格式不正确")
    private String email;

    /**
     * 手机号
     */
    private String mobile;

    /**
     * 状态  0：禁用   1：正常
     */
    private Byte status;

    /**
     * 部门ID
     */
    @Column(name = "dept_id")
    private Long deptId;
    @Column(name = "company_id")
    @ApiParam("公司的id")
    private Integer companyId;
    /**
     * 创建时间
     */
    @Column(name = "create_time")
    private Date createTime;

    @Column(name="login_name")
    @NotBlank(message = "登录名字不能为空")
    private String loginName;
    @Column(name = "dept_code")
    private String deptCode;

    /**
     * 人员所属部门的顶级部门的code
     */
    @Column(name="company_dept_code")
    private String companyDeptCode;
    
    @ApiParam("出生日期")
    private Date birthday;
    
    @ApiParam("性别")
    private Boolean gender;


    @ApiParam("文化程度")
    @Column(name = "degree_of_education")
    private String degreeOfEducation;


    @ApiParam("入职时间")
    @Column(name = "entry_date")
    private Date entryDate;
    
    @ApiParam("岗位")
    private String duty;

    @ApiParam("短号")
    @Column(name = "short_phone")
    private String shortPhone;
    
    @ApiParam("班组ID")
    @Column(name = "team_id")
    private Integer teamId;

    @ApiParam("是否是临时用户")
    private Boolean temp;
    
    @ApiParam("18位身份证号")
    @Column(name = "id_number")
    private String idNumber;
    
    @ApiParam("是否受过三级培训")
    @Column(name = "entry_train")
    private Boolean entryTrain;
   
    @ApiParam("离职状态，未离职，调离，离职")
    @Column(name = "leave_flag")
    private String leaveFlag;

    public String getLeaveFlag() {
        return leaveFlag;
    }

    public void setLeaveFlag(String leaveFlag) {
        this.leaveFlag = leaveFlag;
    }
    
    @ApiParam("岗位调整状态，未调整，调岗，脱岗")
    @Column(name = "reassign_flag")
    private String reassignFlag;

    public String getReassignFlag() {
        return reassignFlag;
    }

    public void setReassignFlag(String reassignFlag) {
        this.reassignFlag = reassignFlag;
    }
    
    @ApiParam("离职时间")
    @Column(name = "leave_date")
    private Date leaveDate;
    
    public Date getLeaveDate() {
        return leaveDate;
    }
    public void setLeaveDate(Date leaveDate) {
        this.leaveDate = leaveDate;
    }
    @ApiParam("岗位调整时间")
    @Column(name = "reassign_date")
    private Date reassignDate;
    
    public Date getReassignDate() {
        return reassignDate;
    }

    public void setReassignDate(Date reassignDate) {
        this.reassignDate = reassignDate;
    }
    
    @ApiParam("是否受过转岗培训")
    @Column(name = "reassign_train")
    private Boolean reassignTrain;
    
    public Boolean getReassignTrain() {
        return reassignTrain;
    }

    public void setReassignTrain(Boolean reassignTrain) {
        this.reassignTrain = reassignTrain;
    }
    
    
    @ApiParam("现入职单位")
    @Column(name = "current_comp")
    private String currentComp;

    private String openId;

    private String unionId;

    /**
     * 头像的文件id
      */
    private Integer headFileId;


    @Column(name = "enterprise_id")
    private Integer enterpriseId;

    public String getCurrentComp() {
        return currentComp;
    }

    public void setCurrentComp(String currentComp) {
        this.currentComp = currentComp;
    }

    /**
     * 岗位
     */
    @Transient
    private List<SysUserPost> posts=new ArrayList<>();
    @Transient
    private Integer num;

    @Transient
    private String deptName;
    @Transient
    private String teamName;
    @Transient
    private String companyName;
    @Transient
    private Integer parentCompanyId;

    /**
     * 微信端的sessionKey
     */
    @Transient
    private String session_key;
    @Transient
    private List<SysRole> roles=new ArrayList<>();


    @Transient
    private PageInfo sysNoticePageInfo=new PageInfo();

    /**
     * 登入人员公司logoid
     */
    @Transient
    private Integer logoFileId;

    /**
     * 系统分配的数据源
     */
    @Transient
    private List<Integer> companyIds=new ArrayList<>();

    @Transient
    private Integer unreadNoticeCount=0;

    /**
     * 用户头像路径
     */
    @Transient
    private String headPath;

    @Transient
    private String companyLogPath;

    @Transient
    private List<Integer> addRoleIds=new ArrayList<>();

    public List<Integer> getAddRoleIds() {
        return addRoleIds;
    }

    public void setAddRoleIds(List<Integer> addRoleIds) {
        this.addRoleIds = addRoleIds;
    }

    public Integer getEnterpriseId() {
        return enterpriseId;
    }

    public void setEnterpriseId(Integer enterpriseId) {
        this.enterpriseId = enterpriseId;
    }

    public String getSession_key() {
        return session_key;
    }

    public void setSession_key(String session_key) {
        this.session_key = session_key;
    }

    public String getCompanyLogPath() {
        return companyLogPath;
    }

    public void setCompanyLogPath(String companyLogPath) {
        this.companyLogPath = companyLogPath;
    }

    public String getHeadPath() {
        return headPath;
    }

    public void setHeadPath(String headPath) {
        this.headPath = headPath;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getUnionId() {
        return unionId;
    }

    public void setUnionId(String unionId) {
        this.unionId = unionId;
    }

    public Integer getUnreadNoticeCount() {
        return unreadNoticeCount;
    }

    public void setUnreadNoticeCount(Integer unreadNoticeCount) {
        this.unreadNoticeCount = unreadNoticeCount;
    }

    public Integer getHeadFileId() {
        return headFileId;
    }

    public void setHeadFileId(Integer headFileId) {
        this.headFileId = headFileId;
    }

    public List<SysUserPost> getPosts() {
        return posts;
    }

    public void setPosts(List<SysUserPost> posts) {
        this.posts = posts;
    }

    public List<Integer> getCompanyIds() {
        return companyIds;
    }

    public void setCompanyIds(List<Integer> companyIds) {
        this.companyIds = companyIds;
    }


    public Integer getLogoFileId() {
        return logoFileId;
    }

    public void setLogoFileId(Integer logoFileId) {
        this.logoFileId = logoFileId;
    }

    private List<Integer> deptIds=new ArrayList<>();

    public Boolean getEntryTrain() {
        return entryTrain;
    }

    public void setEntryTrain(Boolean entryTrain) {
        this.entryTrain = entryTrain;
    }
    
    public String getIdNumber() {
        return idNumber;
    }

    public void setIdNumber(String idNumber) {
        this.idNumber = idNumber;
    }

    
    public Boolean getTemp() {
        return temp;
    }

    public void setTemp(Boolean temp) {
        this.temp = temp;
    }

    public PageInfo getSysNoticePageInfo() {
        return sysNoticePageInfo;
    }

    public void setSysNoticePageInfo(PageInfo sysNoticePageInfo) {
        this.sysNoticePageInfo = sysNoticePageInfo;
    }

    public String getTeamName() {
        return teamName;
    }

    public void setTeamName(String teamName) {
        this.teamName = teamName;
    }


    public Integer getParentCompanyId() {
        return parentCompanyId;
    }

    public void setParentCompanyId(Integer parentCompanyId) {
        this.parentCompanyId = parentCompanyId;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public List<SysRole> getRoles() {
        return roles;
    }

    public List<Integer> getDeptIds() {
        return deptIds;
    }

    public void setDeptIds(List<Integer> deptIds) {
        this.deptIds = deptIds;
    }

    public void setRoles(List<SysRole> roles) {
        this.roles = roles;
    }

    public SysUser(String password, String loginName) {
        this.password = password;
        this.loginName = loginName;
    }

    public SysUser() {
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public Integer getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }

    public String getShortPhone() {
        return shortPhone;
    }

    public void setShortPhone(String shortPhone) {
        this.shortPhone = shortPhone;
    }

    public String getCompanyDeptCode() {
        return companyDeptCode;
    }

    public void setCompanyDeptCode(String companyDeptCode) {
        this.companyDeptCode = companyDeptCode;
    }

    public String getDeptCode() {
        return deptCode;
    }

    public void setDeptCode(String deptCode) {
        this.deptCode = deptCode;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    /**
     * @return user_id
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * @param userId
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * 获取用户名
     *
     * @return username - 用户名
     */
    public String getUsername() {
        return username;
    }

    /**
     * 设置用户名
     *
     * @param username 用户名
     */
    public void setUsername(String username) {
        this.username = username;
    }

    /**
     * 获取密码
     *
     * @return password - 密码
     */
    public String getPassword() {
        return password;
    }

    /**
     * 设置密码
     *
     * @param password 密码
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * 获取盐
     *
     * @return salt - 盐
     */
    public String getSalt() {
        return salt;
    }

    /**
     * 设置盐
     *
     * @param salt 盐
     */
    public void setSalt(String salt) {
        this.salt = salt;
    }

    /**
     * 获取邮箱
     *
     * @return email - 邮箱
     */
    public String getEmail() {
        return email;
    }

    /**
     * 设置邮箱
     *
     * @param email 邮箱
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * 获取手机号
     *
     * @return mobile - 手机号
     */
    public String getMobile() {
        return mobile;
    }

    /**
     * 设置手机号
     *
     * @param mobile 手机号
     */
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    /**
     * 获取状态  0：禁用   1：正常
     *
     * @return status - 状态  0：禁用   1：正常
     */
    public Byte getStatus() {
        return status;
    }

    /**
     * 设置状态  0：禁用   1：正常
     *
     * @param status 状态  0：禁用   1：正常
     */
    public void setStatus(Byte status) {
        this.status = status;
    }

    /**
     * 获取部门ID
     *
     * @return dept_id - 部门ID
     */
    public Long getDeptId() {
        return deptId;
    }

    /**
     * 设置部门ID
     *
     * @param deptId 部门ID
     */
    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    /**
     * 获取创建时间
     *
     * @return create_time - 创建时间
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 设置创建时间
     *
     * @param createTime 创建时间
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    
    public Date getBirthday() {
        return birthday;
    }

    /**
     * ���ó�������
     *
     * @param birthday ��������
     */
    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    /**
     * ��ȡ�Ļ��̶�
     *
     * @return degree_of_education - �Ļ��̶�
     */
    public String getDegreeOfEducation() {
        return degreeOfEducation;
    }

    /**
     * �����Ļ��̶�
     *
     * @param degreeOfEducation �Ļ��̶�
     */
    public void setDegreeOfEducation(String degreeOfEducation) {
        this.degreeOfEducation = degreeOfEducation;
    }

    /**
     * ��ȡ��ְʱ��
     *
     * @return entry_date - ��ְʱ��
     */
    public Date getEntryDate() {
        return entryDate;
    }

    /**
     * ������ְʱ��
     *
     * @param entryDate ��ְʱ��
     */
    public void setEntryDate(Date entryDate) {
        this.entryDate = entryDate;
    }
    public String getDuty() {
        return duty;
    }

    /**
     * ���ø�λ��ְ��
     *
     * @param duty ��λ��ְ��
     */
    public void setDuty(String duty) {
        this.duty = duty;
    }
    
    /**
     * ��ȡ�Ա�0Ů��1��
     *
     * @return gender - �Ա�0Ů��1��
     */
    public Boolean getGender() {
        return gender;
    }

    /**
     * �����Ա�0Ů��1��
     *
     * @param gender �Ա�0Ů��1��
     */
    public void setGender(Boolean gender) {
        this.gender = gender;
    }
    
    public Integer getTeamId() {
        return teamId;
    }


    public void setTeamId(Integer teamId) {
        this.teamId = teamId;
    }
}